#include<bits/stdc++.h>
#define M 100005
using namespace std;
int n, a[M];
signed main()
{
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    scanf("%d", &n);
    for(int i = 1; i <= n; i++) scanf("%d", &a[i]);
    sort(a + 1, a + n + 1);
    int rem = 0;
    for(int i = 1; i <= n; i++)
    {
        int j = i;
        while(j < n && a[j + 1] == a[i]) j++;
        rem = max(rem - (j - i + 1), 0);
        rem += j - i + 1;
    }
    printf("%d\n", rem);
    return 0;
}
